import User.AdminUser;
import User.NormalUser;
import User.User;
import book.booklist;

import java.util.Scanner;

public class main {
    public static User login() {
        System.out.println("请输入姓名");
        Scanner scanner = new Scanner(System.in);
        String name = scanner.nextLine();
        System.out.println("请输入身份： 1管理员  2用户");
        int choice = scanner.nextInt();
        while(choice!=1&&choice!=2){
             choice = scanner.nextInt();
        } 
        if (choice == 1) {
            return new AdminUser(name);
        } else  {
            return new NormalUser(name);
        }
    }
    public static void main(String[] args) {
        User user = login();
        booklist booklist=new booklist();
        while(true){
            int choice=user.menu();
            user.dooperation(choice,booklist);
        }
    }
}